#include "Thread.hpp"
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <memory>

using std::unique_ptr;

class MyTask{
public:
    MyTask(){
        srand(time(NULL));
    }

    void process(){
        int cnt = 10;
        while(cnt-- > 0){
            int num = rand() % 100;
            printf("num = %d\n",num);
            sleep(1);
        }
    }
};

int main()
{
    unique_ptr<th::Thread> thread(
            new th::Thread( std::bind(&MyTask::process,MyTask()) ));

    thread->start();
    thread->join();
    return 0;
}

